﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Smartee.RichText
{
    public sealed class Document : Body
    {
        private Body _header = new Body();
        private Body _footer = new Body();

        public Body Header { get { return _header; } }
        public Body Footer { get { return _footer; } }

        private List<FontConfiguration> _fonts = new List<FontConfiguration>();
        public List<FontConfiguration> Fonts { get { return _fonts; } }
        private List<ColorConfiguration> _colors = new List<ColorConfiguration>();
        public List<ColorConfiguration> Colors { get { return _colors; } }

        public override void Accept(IVisitor visitor)
        {
            visitor.StartVisit(this);

            if (!_header.IsEmpty)
            {
                visitor.StartHeader(this);
                _header.Accept(visitor);
                visitor.EndHeader(this);
            }

            if (!_footer.IsEmpty)
            {
                visitor.StartFooter(this);
                _footer.Accept(visitor);
                visitor.EndFooter(this);
            }

            base.Accept(visitor);
            visitor.EndVisit(this);
        }
    }
}
